{% extends "admin/base_site.html" %}
{% load static %}
{% load i18n %}

{% block breadcrumbs %}
  <div class="breadcrumbs">
    <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> &rsaquo;
    <a href="{% url 'admin:app_list' app_label='qa' %}">{% trans "QC" %}</a> &rsaquo;
    {% trans "Copy References & Tolerances Preview" %}
  </div>
{% endblock %}

{% block content %}

<h1>{% trans "Preview Copying Reference & Tolerances " %}</h1>


<table>
  <tbody>
    <tr>
      <th>{% trans "Test List (Cycle)" %}:</th>
      <td>{{ source_test_list }}</td>
    </tr>
    <tr>
      <th>{% trans "Source Unit" %}</th>
      <td>{{source_unit}}</td>
    </tr>
    <tr>
      <th>{% trans "Dest Unit" %}</th>
      <td>{{dest_unit}}</td>
    </tr>
  </tbody>
</table>

<table>
  <thead>
    <tr>
      <th>{% trans "Test" %}</th>
      <th>{{ dest_unit }} {% trans "Current Reference" %}</th>
      <th>{{ dest_unit }} {% trans "Current Tolerance" %}</th>
      <th>{% trans "New Reference" %}</th>
      <th>{% trans "New Tolerance" %}</th>
    </tr>
  </thead>
  <tbody>
    {% for dest, source in dest_source_utis %}
      <tr>
        <td>{{dest.test}}</td>
        <td>{{dest.reference.value_display}}</td>
        <td>{% firstof dest.tolerance "<em>--</em>" %}</td>
        <td>{{source.reference.value_display}}</td>
        <td>{% firstof source.tolerance "<em>--</em>" %}</td>
      </tr>
    {% endfor %}
  </tbody>
</table>

<form action="" method="post">{% csrf_token %}
  {% for field in form %}
    {{ field.as_hidden }}
  {% endfor %}
  <input type="hidden" name="{{ stage_field }}" value="2" />
  <input type="hidden" name="{{ hash_field }}" value="{{ hash_value }}" />
  <p>
    <input name="cancel" type="submit" value="{% trans "Cancel" %}" />
    <input name="confirm" type="submit" value="{% trans "Confirm" %}" />
  </p>
</form>

{% endblock %}


